global.elevator_state = 'waiting'

with (obj_control)
{
    alarm[1] = global.waiting_time * 30
}

with (obj_victim)
{
    if state == 'runaway'
    {
        mypath = path_add()
        path_add_point(mypath, x, y, 100)
        path_add_point(mypath, 160, 392+32, 100)
        path_add_point(mypath, 160, 392, 100)
        path_set_closed(mypath, false)
        path_start(mypath, global.walking_speed * 2, 0, false)
        
        state = 'rushout'
        global.otherpos[pos_idx] = 0
        global.npc_count -= 1
    }
}

if global.current_floor == global.start_floor
{
    with (obj_player)
    {
        event_user(0)
    }
}
else
{
    for (i = 0; i < global.new_comers_count; i += 1)
    {
        with (global.new_comers[i])
        {
            event_user(0)
        }
    }
}
